<!--
  @author wangjie
  @since 2019/07/31
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<!--表格id与lay-filter属性一致，统一定义为zmn-table-->
<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox', fixed: 'left', width:50 }"></th>
        <th lay-data="{field:'sceneId', unresize:true, align:'center'}">场景ID</th>
        <th lay-data="{field:'type',  unresize:true, align:'left'}">场景分类</th>
        <th lay-data="{field:'sceneName',  unresize:true, align:'left'}">场景名称</th>
        <th lay-data="{field:'remarks',  unresize:true, align:'left'}">场景备注</th>
        <th lay-data="{field:'status',  unresize:true, align:'left'}">状态</th>
        <th lay-data="{field:'updater',  unresize:true, align:'left'}">最近修改人</th>
        <th lay-data="{field:'updateTime', unresize:true, align:'left'}">最近修改日期</th>
        <!--规定操作列置于最后-->
        <th lay-data="{field:'操作', unresize:true, align:'center', fixed:'right'}">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="item:${items}">
        <td></td>
        <td th:text="${item.sceneId}"></td>
        <td th:text="${T(com.zmn.brs.common.enums.SceneTypeEnum).getTypeName(item.type)}"></td>
        <td th:text="${item.sceneName}"></td>
        <td th:text="${item.remarks}"></td>
        <!--<td th:text="${T(com.zmn.plat.common.dictionary.StatusEnum).getName(item.status)}"></td>-->
        <td>
            <div>
                <input type="checkbox" name="status" id="status" th:key="${item.sceneId}" th:value="${item.status}"
                       lay-text="ON|OFF" lay-skin="switch" lay-filter="chk_one_status"
                       th:checked="${item.status == 2}"/>
            </div>
        </td>
        <td th:text="${item.updater}"></td>
        <td th:text="${T(com.zmn.common.utils.date.DateUtil).toString(item.updateTime)}"></td>
        <td>
            <a class="layui-btn layui-btn-xs layui-btn-primary"
               th:href="|/brs/scene/info.action?sceneId=${item.sceneId}|">详情</a>
            <a class="layui-btn layui-btn-xs layui-btn-primary"
               th:href="|/brs/scene/eventList.action?sceneId=${item.sceneId}|">事件管理</a>
        </td>
    </tr>
    </tbody>
</table>
